﻿@model GitCandy.Models.RepositoryModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, SR.Repository_CreateTitle);
}

<h3>@SR.Repository_CreateTitle</h3>


@using (Html.BeginForm("Create", "Repository", FormMethod.Post))
{
    <dl class="dl-horizontal col-md-8">

        <dt>@Html.DisplayNameFor(s => s.Name)</dt>
        <dd>@Html.TextBoxFor(s => s.Name, new { @class = "form-control" })</dd>
        <dd>
            <span class="text-danger">
                @Html.ValidationMessageFor(s => s.Name)
            </span>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.IsPrivate)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.IsPrivate, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.AllowAnonymousRead)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.AllowAnonymousRead, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.AllowAnonymousWrite)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.AllowAnonymousWrite, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.Description)</dt>
        <dd>@Html.TextAreaFor(s => s.Description, 4, 0, new { @class = "form-control" })</dd>
        <dd>
            <span class="text-danger">
                @Html.ValidationMessageFor(s => s.Description)
            </span>
        </dd>

        <dt></dt>
        <dd>@Html.ValidationSummary(true, SR.Repository_CreationUnsuccessfull, new { @class = "alert alert-dismissable alert-danger" })</dd>

        <dt></dt>
        <dd>
            <button type="submit" class="btn btn-primary">@SR.Shared_Create</button> &nbsp;
            <button type="reset" class="btn btn-inverse">@SR.Shared_Reset</button> &nbsp;
        </dd>
    </dl>
}
